Skip to content

Conversation

novsource
Copy link

@novsource novsource commented Jun 12, 2024

Closes [#3387], [#6408]

Context

At the moment, the Slider implementation does not allow thumbs to pass through each other (the Slider is in strict mode, as it were). However, many libraries allow you to do this (more information about this is written here #6408).
This PR implements the ability for thumbs to pass through each other. In order to enable this additional feature, you need to pass a new allowSwap prop to the Slider.
In addition, this PR fixes the bug when the sliders got stuck in each other ([#3387], [#6408])

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Testing default behavior (no swap) with multiple thumbs

http://localhost:9003/?path=/story/slider-hooks--4-stacked-thumbs-with-disabled-swap&strict=true

With mouse

Disabled.Swap.-.Mouse.mov

WIth arrows

Disabled.Swap.Arrows.mov

With keys

Disabled.Swap.Keys.mov

Testing the swap of thumbs

http://localhost:9003/?path=/story/slider-hooks--4-stacked-thumbs-with-enabled-swap&providerSwitcher-express=false&strict=true

With mouse

Enabled.Swap.Mouse.mov

With arrows

Enabled.Swap.Arrows.mov

With keys

Enabled.Swap.Keys.mov

🧢 Your Project:

N/A

@novsource novsource changed the title [RA] Implementation of swapping thumbs in the slider [RAC] Implementation of swapping thumbs in the slider Jun 13, 2024
@devongovett
Copy link
Member

Going to close this. The team discussed and decided not to support this behavior at this time. There are some behavioral and accessibility challenges here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants